﻿CREATE TABLE Users (Id bigint IDENTITY(1,1) PRIMARY KEY, UserName	nvarchar(100)	NOT NULL,Email	nvarchar(100)	NOT NULL,Password	nvarchar(20)	NOT NULL,PasswordQuestion	nvarchar(100)	NULL,PasswordAnswer	nvarchar(100)	NULL,Comment	nvarchar(4000)	NULL,IsApproved	bit	NOT NULL,IsLockedOut		bit	NOT NULL,CreationDate	datetime	NOT NULL,LastLoginDate	datetime	NULL,LastActivityDate	datetime	NULL,LastPasswordChangedDate	datetime	NOT NULL,LastLockoutDate	datetime	NOT NULL);
CREATE TABLE Roles (Id bigint IDENTITY(1,1) PRIMARY KEY,Name	nvarchar(100)	NOT NULL );
CREATE TABLE UsersRoles (Id bigint IDENTITY(1,1) PRIMARY KEY,UserId bigint NOT NULL,RoleId bigint NOT NULL);
CREATE TABLE LogEntries (  Id bigint IDENTITY(1,1) PRIMARY KEY,  Created datetime,  Severity tinyint,  Category tinyint,  Source nvarchar(4000),  Message nvarchar(4000),  SystemData nvarchar(4000),  UserName nvarchar(20));
CREATE TABLE ConfigSettings (  Id bigint IDENTITY(1,1) PRIMARY KEY,  Code nvarchar(100),  Value nvarchar(4000) ); 